package com.fr.base.core.json;

import com.fr.base.core.BaseCoreUtils;
import java.util.Arrays;

public class JSONFunction
  implements JSONString
{
  private String[] args;
  private String statement;

  public JSONFunction(String[] paramArrayOfString, String paramString)
  {
    this.args = paramArrayOfString;
    this.statement = paramString;
  }

  public String toJSONString()
  {
    return toJSONString(true);
  }

  public String toString()
  {
    return toJSONString();
  }

  public String toJSONString(boolean paramBoolean)
  {
    if (paramBoolean)
    {
      String str = "function(" + BaseCoreUtils.join(Arrays.asList(this.args), ",") + ")";
      str = str + "{\n" + this.statement + "\n}";
      return str;
    }
    return toString();
  }
}